package com.igrowing.maker.generator.main;

public class MainGenerator extends GenerateTemplate{

    @Override
    protected void buildDist(String outputPath, String sourceCopyDestPath, String jarPath, String shellOutputFilePath) {
        System.out.println("舍去精简版");
    }

   // public static void main(String[] args) throws Exception {




//        Meta meta = MetaManager.getMetaObject();
//        System.out.println(meta);
//
//        // 输出根路径
//        String projectPath = System.getProperty("user.dir");
//        String outputPath = projectPath + File.separator + "generated" + File.separator + meta.getName();
//        if (!FileUtil.exist(outputPath)) {
//            FileUtil.mkdir(outputPath);
//        }
//
//
//        // 读取 resources 目录
//        ClassPathResource classPathResource = new ClassPathResource("");
//        String inputResourcePath = classPathResource.getAbsolutePath();
//
//        // Java 包基础路径
//        String outputBasePackage = meta.getBasePackage();
//        String outputBasePackagePath = StrUtil.join("/", StrUtil.split(outputBasePackage, "."));
//        String outputBaseJavaPackagePath = outputPath + File.separator + "src/main/java/" + outputBasePackagePath;
//
//        String inputFilePath;
//        String outputFilePath;
//
//        // model.DataModel
//        inputFilePath = inputResourcePath + File.separator + "template/java/model/DataModel.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/model/DataModel.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // cli.command.ConfigCommand
//        inputFilePath = inputResourcePath + File.separator + "template/java/cli/command/ConfigCommand.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/cli/command/ConfigCommand.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // cli.command.GenerateCommand
//        inputFilePath = inputResourcePath + File.separator + "template/java/cli/command/GenerateCommand.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/cli/command/GenerateCommand.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // cli.command.ListCommand
//        inputFilePath = inputResourcePath + File.separator + "template/java/cli/command/ListCommand.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/cli/command/ListCommand.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // cli.CommandExecutor
//        inputFilePath = inputResourcePath + File.separator + "template/java/cli/CommandExecutor.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/cli/CommandExecutor.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // Main
//        inputFilePath = inputResourcePath + File.separator + "template/java/Main.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/Main.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // generator.DynamicGenerator
//        inputFilePath = inputResourcePath + File.separator + "template/java/generator/DynamicGenerator.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/generator/DynamicGenerator.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // generator.MainGenerator
//        inputFilePath = inputResourcePath + File.separator + "template/java/generator/MainGenerator.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/generator/MainGenerator.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // generator.StaticGenerator
//        inputFilePath = inputResourcePath + File.separator + "template/java/generator/StaticGenerator.java.ftl";
//        outputFilePath = outputBaseJavaPackagePath + "/generator/StaticGenerator.java";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // pom.xml
//        inputFilePath = inputResourcePath + File.separator + "template/pom.xml.ftl";
//        outputFilePath = outputPath + File.separator + "pom.xml";
//        DynamicFileGenerator.doGenerate(inputFilePath, outputFilePath, meta);
//
//        // 构建 jar 包
//        JarGenerator.doGenerate(outputPath);
//
//        // 封装脚本
//        String shellOutputFilePath = outputPath + File.separator + "generator";
//        String jarName = String.format("%s-%s-jar-with-dependencies.jar", meta.getName(), meta.getVersion());
//        String jarPath = "target/" + jarName;
//        ScriptGenerator.doGenerate(shellOutputFilePath, jarPath);
  //  }
}
